#include <string.h>
#include <iostream>
using std::cout;
using std::endl;

class Person{
public:

    //构造函数
    Person(const char *name,int age)
    :_name(new char[strlen(name)+1]()),
    _age(age)
    {
        strcpy(_name,name);
    }

    Person(){}

    //shallow copy
    Person (const Person &);


    //析构函数
    ~Person(){
        if(_name){
            delete []_name;
            _name = nullptr;
        }
    }

private:
    char *_name;
    int _age;
};




void test(){

}

int main()
{
    

    test ();
    return 0;
}

